gtkgstsink.c: Support EGL on Windows as well
authorChun-wei Fan <fanchunwei@src.gnome.org>
Mon, 17 May 2021 08:04:53 +0000 (16:04 +0800)
committerChun-wei Fan <fanchunwei@src.gnome.org>
Mon, 24 May 2021 11:04:14 +0000 (19:04 +0800)
commitccdec5da7788a4d84432cb2deb91ae851ca30c99
tree8ff6492994a67b2ce6a7ed3f5dd98a5080385987
parent52d1c0c2719a5a729cf17c90262d6f542eab1d11
gtkgstsink.c: Support EGL on Windows as well

Add support to look for and use the EGL context in Windows if it was activated
instead of desktop OpenGL.

GstGL may have been built with or without EGL/libANGLE support, so if it were,
check in GstGL whether we have gst_gl_display_new_with_type() to create a
GstGLDisplay that is of the GST_GL_WINDOW_WIN32 type when we are using
Desktop OpenGL (WGL), otherwise we show messages indicating that envvars
need to be set to initialize GstGL properly.

Due to a bug in GstGL, the GstGLContext can only be set up successfully
if one of the following is true:

*  An OpenGL 3.x or later emulator, such as Mesa is used (for WGL)
*  The latest GstGL master is being used, at the time of writing (for
   WGL)
*  GTK, libepoxy and GstGL are all built only with WGL support (for WGL)
*  EGL is being used in GTK at runtime

Special thanks to Matthew Waters for the help during the process.
modules/media/gtkgstsink.c
modules/media/meson.build